When redirecting the output of the echo command using '>' on bash, the
authorEwan Mellor <ewan@xensource.com>
Thu, 14 Sep 2006 06:57:41 +0000 (07:57 +0100)
committerEwan Mellor <ewan@xensource.com>
Thu, 14 Sep 2006 06:57:41 +0000 (07:57 +0100)
output seems to be broken up into multiple write()s (depending on the
version of busybox?). Unfortunately /dev/tpm0 needs to have the complete
command written to in one chunk. The work-around 'echo <string> > file ;
cat file > /dev/tpm0' seems to get around this problem.
The patch also removes a redundant test and error output.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
tools/xm-test/tests/vtpm/06_vtpm-susp_res_pcrs.py
tools/xm-test/tests/vtpm/07_vtpm-mig_pcrs.py
tools/xm-test/tests/vtpm/08_vtpm-mig_pcrs.py
tools/xm-test/tests/vtpm/vtpm_utils.py

index 9ac1ef5a9c4798f5f9e44e8bf348c132665c5403..42661b83d81b4a04281313ef77ea7d9cf94f6ea8 100644 (file)
@@ -42,7 +42,7 @@ except ConsoleError, e:
     FAIL("Error while creating /dev/tpm0")
 
 try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > /dev/tpm0")
+    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
 except ConsoleError, e:
     saveLog(console.getHistory())
     vtpm_cleanup(domName)
index f8c437c9f90dfd867deccde15a12e5e33071eb90..f86e0505191122a023c9d10eee802e9650112bbd 100644 (file)
@@ -43,7 +43,7 @@ except ConsoleError, e:
     FAIL("Error while creating /dev/tpm0")
 
 try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > /dev/tpm0")
+    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
 except ConsoleError, e:
     saveLog(console.getHistory())
     vtpm_cleanup(domName)
index 5872e5a7d46f1eab3430039a223a1f0dbe7c70f8..f1b460c0e22dbf1b1dacd181b6ddb9b7e7274457 100644 (file)
@@ -43,7 +43,7 @@ except ConsoleError, e:
     FAIL("Error while creating /dev/tpm0")
 
 try:
-    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > /dev/tpm0")
+    run = console.runCmd("echo -ne \"\\x00\\xc1\\x00\\x00\\x00\\x22\\x00\\x00\\x00\\x14\\x00\\x00\\x00\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\0xf\\x10\\x11\\x12\\x13\\x14\" > seq; cat seq > /dev/tpm0")
 except ConsoleError, e:
     saveLog(console.getHistory())
     vtpm_cleanup(domName)
index 01a60f90c64ad5d1c006af1b54eab8824ad54fc4..70af1d30f804bc86ce95502bcdf3cec966a83812 100644 (file)
@@ -8,9 +8,6 @@ from XmTestLib import *
 if ENABLE_HVM_SUPPORT:
     SKIP("vtpm tests not supported for HVM domains")
 
-if not os.path.exists("/dev/tpm0"):
-    SKIP("This machine has no hardware TPM; cannot run this test")
-
 status, output = traceCommand("ps aux | grep vtpm_manager | grep -v grep")
 if output == "":
     FAIL("virtual TPM manager must be started to run this test")